<template>
  <div class="drugs">
    <img
      :src="drugsData.brand.logo"
      class="drugs-img"
    >
    <div class="drugs-content">
      <div class="drugs-name">
        <div class="drugs-name-title">
          药品
        </div>
        <div class="drugs-name-text">
          {{ drugsData.wiki_name ||'暂无信息' }}
        </div>
      </div>
      <div class="drugs-brand">
        <div class="drugs-brand-title">
          品牌
        </div>
        <div class="drugs-brand-text">
          {{ drugsData.brand.brand_name||'暂无信息' }}
        </div>
      </div>
      <div class="drugs-country">
        <div class="drugs-country-title">
          产地
        </div>
        <div class="drugs-country-text">
          {{ drugsData.brand.country||'暂无信息' }}
        </div>
      </div>
      <div class="drugs-manufacturer">
        <div class="drugs-manufacturer-title">
          生产厂商
        </div>
        <div class="drugs-manufacturer-text">
          {{ drugsData.brand.company||'' }}
        </div>
      </div>
      <div class="drugs-specifications">
        <div class="drugs-specifications-title">
          规格
        </div>
        <div
          v-for="(item,index) in drugsData.params"
          :key="index"
        >
          <div
            v-if="item.name==='规格'"
            class="drugs-specifications-text"
          >
            {{ item.value }}
          </div>
        </div>
      </div>
      <div
        v-if="drugsData.auth"
        class="drugs-authentication"
      >
        <div class="drugs-authentication-title">
          认证
        </div>
        <div class="drugs-authentication-item-wrap">
          <div
            v-for="item in drugsData.auth"
            :key="item"
          >
            <div
              class="authentication-icon"
              :style="{ backgroundImage:'url('+authenticationImage[item]+')',backgroundPosition:'center',backgroundRepeat:'no-repeat'}"
            />
          </div>
        </div>
      </div>
      <div class="drugs-component">
        <div class="drugs-component-title">
          成分
        </div>
        <div
          v-for="(item,index) in drugsData.params"
          :key="index"
        >
          <div
            v-if="item.name==='成分'"
            class="drugs-component-text"
          >
            {{ item.value }}
          </div>
        </div>
      </div>
      <div class="drugs-apply">
        <div class="drugs-apply-title">
          适用项目
        </div>
        <div class="drugs-apply-text">
          <div
            v-for="item in drugsData.projects"
            :key="item.wiki_id"
            class="drugs-apply-item"
          >
            {{ item.wiki_name }}
          </div>
        </div>
      </div>
      <div class="drugs-characteristic">
        <div class="drugs-characteristic-title">
          药品特色
        </div>
        <div class="drugs-characteristic-text">
          {{ drugsData.feature||'' }}
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import authenticationImg from '@/utils/authenticationImg.js'
export default {
  props: {
    drugsData: {
      type: Object,
      default: () => { }
    }
  },
  data() {
    return {
      authenticationImage: {}
    }
  },
  created() {
    this.authenticationImage = authenticationImg
  }
}
</script>
<style scoped lang="scss">
.drugs-img {
  width: 348px;
  height: 162px;
  background: rgba(246, 246, 246, 1);
  border-radius: 4px;
  border: 1px solid #ccc;
}
.drugs-content {
  margin-top: 22px;
  .drugs-name {
    display: flex;
    .drugs-name-title {
      width: 64px;
      height: 22px;
      margin-left: 15px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
    .drugs-name-text {
      margin-left: 44px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(51, 51, 51, 1);
    }
  }
  .drugs-brand {
    display: flex;
    .drugs-brand-title {
      width: 64px;
      height: 22px;
      margin-left: 15px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
    .drugs-brand-text {
      margin-left: 44px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(51, 51, 51, 1);
    }
  }
  .drugs-country {
    display: flex;
    .drugs-country-title {
      width: 64px;
      height: 22px;
      margin-left: 15px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
    .drugs-country-text {
      margin-left: 44px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(51, 51, 51, 1);
    }
  }
  .drugs-manufacturer {
    display: flex;
    .drugs-manufacturer-title {
      width: 64px;
      height: 22px;
      margin-left: 15px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
    .drugs-manufacturer-text {
      width: 243px;
      margin-left: 44px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(51, 51, 51, 1);
    }
  }
  .drugs-authentication {
    display: flex;
    .drugs-authentication-title {
      width: 64px;
      height: 22px;
      margin-left: 15px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
    .authentication-icon {
      width: 47px;
      height: 20px;
      background-size: 100% 100%;
      margin-right: 6px;
      margin-bottom: 2px;
    }
    .drugs-authentication-item-wrap {
      width: 243px;
      display: flex;
      flex-wrap: wrap;
      margin-left: 44px;
      margin-top: 17px;
    }
  }
  .drugs-specifications {
    display: flex;
    .drugs-specifications-title {
      width: 64px;
      height: 22px;
      margin-left: 15px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
    .drugs-specifications-text {
      width: 243px;
      margin-left: 44px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(51, 51, 51, 1);
    }
  }
  .drugs-component {
    display: flex;
    .drugs-component-title {
      width: 64px;
      height: 22px;
      margin-left: 15px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
    .drugs-component-text {
      width: 243px;
      margin-left: 44px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(51, 51, 51, 1);
    }
  }
  .drugs-apply {
    display: flex;
    .drugs-apply-title {
      width: 64px;
      height: 22px;
      margin-left: 15px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
    .drugs-apply-text {
      width: 243px;
      margin-left: 44px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(51, 51, 51, 1);
      display: flex;
      flex-wrap: wrap;
      .drugs-apply-item {
        padding: 1px 10px;
        margin-right: 10px;
        background: rgba(245, 245, 245, 1);
        border-radius: 15px;
        margin-bottom: 5px;
        font-size: 16px;

        font-weight: 400;
        color: rgba(102, 102, 102, 1);
        line-height: 22px;
      }
    }
  }
  .drugs-characteristic {
    display: flex;
    .drugs-characteristic-title {
      width: 64px;
      height: 22px;
      margin-left: 15px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
    }
    .drugs-characteristic-text {
      width: 225px;
      margin-left: 44px;
      margin-top: 17px;
      font-size: 16px;
      font-weight: 400;
      color: rgba(51, 51, 51, 1);
    }
  }
}
</style>
